package com.demo15;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

public class InputStreamReaderDemo {
    //获取列表中的数据信息展示
    public static void main(String[] args) throws IOException {
        //建立对象信息
        InputStreamReader isr = new InputStreamReader(new FileInputStream("idea_demo\\java\\VideoCopyStreamDemo.java"));

        //单个字符读取信息
//        int chr;
//        while ((chr=isr.read())!=-1){
//            System.out.print((char)chr);
//        }

        char[] chars = new char[1024];
        int len;
        while ((len=isr.read(chars))!=-1){
            System.out.print(new String(chars,0,len));
        }

        isr.close();
    }
}
